//
//  MovieCollectionViewCell.m
//  UI - 豆瓣
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "MovieCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation MovieCollectionViewCell
- (void)dealloc
{
    [_headImageView release];
    [_lable release];
    [_movie release];
    
    [super dealloc];
}


-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        [self createSubview];
        
    }
    return self;
}

-(void)createSubview{

    self.headImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 110, 140)];
    self.headImageView.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.headImageView];
    [self.headImageView release];
    
    self.lable = [[UILabel alloc] initWithFrame:CGRectMake(15, 140, 80, 20)];
    [self.contentView addSubview:self.lable];
    
    
}



-(void)setMovie:(Movie *)movie{

    if (_movie != movie) {
        [_movie release];
        _movie = [movie retain];
    }
    self.lable.text = self.movie.movieName;
    NSURL *url = [NSURL URLWithString:self.movie.pic_url];
    [self.headImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"user.png"]];
}

@end
